package CI.aufgabe2.cip.mynodes;

import java.util.ArrayList;
import java.util.List;

import CI.aufgabe2.cip.SymbolTable;
import CI.aufgabe2.cip.base.AbstractDescr;
import CI.aufgabe2.cip.descriptor.ProcedureDescr;

public class MyProcedureHeadingNode extends MyAbstractNode {

	private static final long serialVersionUID = 1L;

	private final MyIdNode ident;
	private final MyFormalParametersNode formalParams;

	public MyProcedureHeadingNode(MyIdNode ident,
			MyFormalParametersNode formalParams) {
		this.ident = ident;
		this.formalParams = formalParams;
	}

	@Override
	public void print() {
		trace("ProcedureHeadingNode ");
		if (ident != null)
			ident.print();

		if (formalParams != null) {
			formalParams.print();
		}
		unindent();
	}
	
	public MyFormalParametersNode getFormalParams(){
		return this.formalParams;
	}
	public List<MyFPSectionNode> getFormalParamsList(){
		return this.formalParams.getList();		
	}
	public MyIdNode getIdent(){
		return this.ident;
	}
	public AbstractDescr compile(SymbolTable sym) {
		if(formalParams != null)
			formalParams.compile(sym);
		return null;
	}

}
